﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransCend.Model;
using TransCend.Util.Page;

namespace TransCend.Result
{
    [Serializable]
    public class PageListResult<T> : ListResult<T> where T : IDictionary
    {

        public PageListResult()
        {

        }

        public PageListResult(IList<T> rows) : base(rows)
        {
            total = rows.Count;
        }

        public PageListResult(PageTools<T> pagetools)
            : base(pagetools.List)
        {
            total = pagetools.GetTotalCount();
            
        }

        public int total
        {
            get;
            set;
        }

        public override object ToJsonObject()
        {
            return this;
        }
    }
}
